package cn.iocoder.yudao.module.system.dal.mysql.userChangeMobileRecordrecord;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.userChangeMobileRecordrecord.UserChangeMobileRecordrecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.userChangeMobileRecordrecord.vo.*;

/**
 * 用户手机更新记录 Mapper
 *
 * @author 谭万全
 */
@Mapper
public interface UserChangeMobileRecordrecordMapper extends BaseMapperX<UserChangeMobileRecordrecordDO> {

    default PageResult<UserChangeMobileRecordrecordDO> selectPage(UserChangeMobileRecordrecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserChangeMobileRecordrecordDO>()
                .likeIfPresent(UserChangeMobileRecordrecordDO::getUsername, reqVO.getUsername())
                .eqIfPresent(UserChangeMobileRecordrecordDO::getPassword, reqVO.getPassword())
                .likeIfPresent(UserChangeMobileRecordrecordDO::getNickname, reqVO.getNickname())
                .eqIfPresent(UserChangeMobileRecordrecordDO::getOldMobile, reqVO.getOldMobile())
                .eqIfPresent(UserChangeMobileRecordrecordDO::getNewMobile, reqVO.getNewMobile())
                .eqIfPresent(UserChangeMobileRecordrecordDO::getDataUrl, reqVO.getDataUrl())
                .inIfPresent(UserChangeMobileRecordrecordDO::getStatus, reqVO.getStatuss())
                .eqIfPresent(UserChangeMobileRecordrecordDO::getDept, reqVO.getDept())
                .likeIfPresent(UserChangeMobileRecordrecordDO::getCompanyName, reqVO.getCompanyName())
                .betweenIfPresent(UserChangeMobileRecordrecordDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(UserChangeMobileRecordrecordDO::getId));
    }

    default List<UserChangeMobileRecordrecordDO> selectList(UserChangeMobileRecordrecordExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserChangeMobileRecordrecordDO>()
                .likeIfPresent(UserChangeMobileRecordrecordDO::getUsername, reqVO.getUsername())
                .eqIfPresent(UserChangeMobileRecordrecordDO::getPassword, reqVO.getPassword())
                .likeIfPresent(UserChangeMobileRecordrecordDO::getNickname, reqVO.getNickname())
                .eqIfPresent(UserChangeMobileRecordrecordDO::getOldMobile, reqVO.getOldMobile())
                .eqIfPresent(UserChangeMobileRecordrecordDO::getNewMobile, reqVO.getNewMobile())
                .eqIfPresent(UserChangeMobileRecordrecordDO::getDataUrl, reqVO.getDataUrl())
                .eqIfPresent(UserChangeMobileRecordrecordDO::getStatus, reqVO.getStatus())
                .eqIfPresent(UserChangeMobileRecordrecordDO::getDept, reqVO.getDept())
                .likeIfPresent(UserChangeMobileRecordrecordDO::getCompanyName, reqVO.getCompanyName())
                .betweenIfPresent(UserChangeMobileRecordrecordDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(UserChangeMobileRecordrecordDO::getId));
    }

}
